@extends('admin.app')

@section('breadcrumb')
    <div class="bg-light lter b-b wrapper-md">
        <ol class="breadcrumb bg-light lter m-n no-padder">
            <li><a href="{{ admin_action('HomeController@index') }}">主页</a></li>
            <li>业务管理</li>
            <li><a href="{{ admin_action('Business\ProjectTypeTemplateController@index') }}">项目类型管理</a></li>
            <li class="active">项目类型-模板属性管理</li>
        </ol>
    </div>
@endsection

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            模板属性列表
        </div>
        <div class="row wrapper">
            <div class="col-sm-8">
                {{--<form class="form-horizontal" method="get"--}}
                      {{--action="{{ admin_action('Business\ProjectTypeTemplateController@index') }}">--}}
                    {{--<div class="row">--}}
                        {{--<div class="col-sm-5">--}}
                            {{--<div class="form-group">--}}
                                {{--<label class="control-label col-sm-4">模板名称</label>--}}
                                {{--<div class="col-sm-8">--}}
                                    {{--<input class="form-control" type="text" placeholder="请输入文章标题" name="name"--}}
                                           {{--value="{{ $query['name'] }}"/>--}}
                                {{--</div>--}}
                            {{--</div>--}}
                        {{--</div>--}}
                        {{--<div class="col-sm-1 text-left">--}}
            {{--<span class="input-group-btn">--}}
              {{--<button class="btn btn-sm btn-default" type="submit">查询</button>--}}
            {{--</span>--}}
                        {{--</div>--}}
                    {{--</div>--}}
                {{--</form>--}}
            </div>
            <div class="col-sm-4 text-right text-center-xs">
                <a class="btn m-b-xs btn-sm btn-default btn-addon"
                   href="{{ admin_action('Business\ProjectTypeTemplateAttributesController@create',[$template_id,'type' => 0]) }}">
                    <i class="fa fa-plus"></i>新增基本信息
                </a>
                <a class="btn m-b-xs btn-sm btn-default btn-addon"
                   href="{{ admin_action('Business\ProjectTypeTemplateAttributesController@create',[$template_id, 'type' => 1]) }}">
                    <i class="fa fa-plus"></i>新增图片信息
                </a>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th>编号</th>
                    <th>属性类型</th>
                    <th>属性名称</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @forelse ($project_type_template_attributes as $project_type_template_attribute)
                    <tr>
                        <td>{{ $project_type_template_attribute->id }}</td>
                        <td>{{ $project_type_template_attribute->template_attribute == 1?'图片信息':'基本信息' }}</td>
                        <td>{{ $project_type_template_attribute->name }}</td>
                        <td>{{ $project_type_template_attribute->sort }}</td>
                        <td>
                            <a class="btn btn-xs btn-primary"
                               href="{{ admin_action('Business\ProjectTypeTemplateAttributesController@edit', [$template_id,$project_type_template_attribute]) }}"
                               data-toggle="tooltip" title="编辑该模板属性">
                                <i class="fa fa-pencil"></i>
                            </a>
                            <form class="inline"
                                  action="{{ admin_action('Business\ProjectTypeTemplateAttributesController@destroy',[$template_id, $project_type_template_attribute]) }}"
                                  method="post">
                                {{ csrf_field() }}
                                {{ method_field('DELETE') }}
                                <button type="button" data-swal-role="delete-confirm" data-swal-title="温馨提示"
                                        data-swal-text="您将删除模板属性 <{{ $project_type_template_attribute->name }}>   "
                                        class="btn btn-xs btn-danger" data-toggle="tooltip" title="删除模板属性">
                                    <i class="fa fa-trash-o"></i>
                                </button>
                            </form>
                        </td>
                    </tr>
                @empty
                    <tr>
                        <td colspan="3" class="text-center">没有找到项目类型模板记录</td>
                    </tr>
                @endforelse
                </tbody>
            </table>
        </div>
        <div class="panel-footer">
            <div class="row">
                <div class="col-sm-12 text-right text-center-xs">
                    {!! $links !!}
                </div>
            </div>
        </div>
    </div>
@endsection